function findMeetmodes($scope, CertusFormAjax) {
    var deptIds ="";
    var compIds = "";

    this.getDepts = function () {
        var company = $("#company").val();
        if(company!=""){
            findCompDepts(company,deptIds);
        }else {
            findCompDepts(compIds,deptIds);
        }
    };

    //获取权限相关部门
    this.findCompDepts = function (company,depts) {
        CertusFormAjax.ajax("findCompDepts", {"compCodes":company,"deptIds":depts,"isBm":"BM"}, function (response) {
            var data = response.data;
            $scope.dept = data;
        });
    };

    //获取所有部门
    this.findAllDepts = function (dept) {
        CertusFormAjax.ajax("findQDepts", {"deptIds":dept}, function (response) {
            var data = response.data;
            $scope.dept = data;
        });
    };

    this.getCompanys = function (comanyCode) {
        CertusFormAjax.ajax("companyListByCode", {"code":comanyCode}, function (response) {
            $scope.comp = JSON.parse(response.data);
        });
    };

    this.getUsers = function (deptCode) {
        CertusFormAjax.ajax("getDeptMembers", {"deptCode":deptCode}, function (response) {
            $scope.userList = response.data;
        });
    };

    CertusFormAjax.ajax("isCrcd", {
        "code": "XMJZ"
    }, function (response) {
        var data = JSON.parse(response.data);
        deptIds = data.deptCode;
        compIds = data.comanyCode;
        if (data.comanyCode!=""){
            this.getCompanys(compIds);
            // findCompDepts(data.comanyCode,deptIds);
        }else{
            $("#company").attr("disabled", "disabled");
            // findAllDepts(data.deptCode);
        }

        if (data.isTrue == true) {
            searchs("", "1", deptIds,compIds, getBeforeDate(-2), getBeforeDate(2));
        } else {
            CertusFormAjax.ajax("getDeptCode", {}, function (response) {
                var data1 = response.data;
                $scope.deptCode = data1;
                $("#deptCode").attr("disabled", "disabled");
                $("#deptFlag").html("归属");
                //默认查询
                searchs(data1, "1", deptIds,compIds, getBeforeDate(-8), getBeforeDate(2));
            });
        };
    });

    $(".clearparam").click(function () {
        // $("#beginTime").val("");
        // $("#endTime").val("");
        $("#company").val("");
        $("#deptCode").val("");
        $("#code").val(1);
        $("#userId").val("");
        $("#proType").val("");

        this.getCompanys(compIds);
        this.findCompDepts(compIds,deptIds);
    });
}

// 结果列表
var meetmodeColumns = [{
  id: 'proName',
  title: '项目名称',
  type: 'string',
  columnClass: 'text-left',
  resolution: function (value, record) {
    var content = '';
    content += '<a href="javascript:void(0);">' + record.proName + '</a>';
    return content;
  }
}, {
  id: 'pmp',
  title: '项目经理',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
}];
var meetmodeOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '结果列表',
  datas: [{
    proName: 'A项目',
    pmp: '张三'
  }, {
    proName: 'B项目',
    pmp: '李四'
  }, {
    proName: 'C项目',
    pmp: '王五'
  }, {
    proName: 'D项目',
    pmp: '赵六'
  }, {
    proName: 'E项目',
    pmp: '诸葛孔明'
  }],
  columns: meetmodeColumns,
  gridContainer: 'meetmodeContainer',
  toolbarContainer: 'meetmodeToolBarContainer',
  tools: '',
  pageSize: 6,
  pageSizeLimit: [10, 15, 20]
};
var meetmodeGrid = $.fn.dlshouwen.grid.init(meetmodeOption);
$(function () {
  meetmodeGrid.load();
});

// 项目进展
var progressColumns = [{
  id: 'p1',
  title: '项目进展',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p3',
  title: '提交人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
}, {
  id: 'p4',
  title: '项目阶段',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}, {
  id: 'p5',
  title: '周期',
  type: 'string',
  width: 120,
  columnClass: 'text-center',
}, {
  id: 'p6',
  title: '提交时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var progressOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目进展',
  datas: [{
    p1: '	1 辅助锦州对接四方数据 增量 2.徐州 接入无线数据（ftp） 定时入库 3.三类警情治理每日研判报表研发，相关模型配置',
    p2: '1、平台功能及页面优化 2、可视化工厂与网关结合集成测试',
    p3: '张三',
    p4: '填写商务信息',
    p5: '2018-10-08至2018-10-12',
    p6: '2018-10-12'
  }],
  columns: progressColumns,
  gridContainer: 'progressContainer',
  toolbarContainer: 'progressToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var progressGrid = $.fn.dlshouwen.grid.init(progressOption);
$(function () {
  progressGrid.load();
});

// 风险和问题
var riskColumns = [{
  id: 'p1',
  title: '风险和问题',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '预规避和处理措施',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p3',
  title: '风险级别',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
}, {
  id: 'p4',
  title: '提交人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
}, {
  id: 'p5',
  title: '创建时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var riskOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '风险和问题',
  datas: [{
    p1: '中石化行业对于安全证书有强制要求，需要项目经理有安全B类证书',
    p2: '该项目我公司无法参加',
    p3: '高',
    p4: '李四',
    p5: '2018-10-18'
  }],
  columns: riskColumns,
  gridContainer: 'riskContainer',
  toolbarContainer: 'riskToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var riskGrid = $.fn.dlshouwen.grid.init(riskOption);
$(function () {
  riskGrid.load();
});

// 项目决策
var makingColumns = [{
  id: 'p1',
  title: '决策内容',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '结论',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p3',
  title: '提交人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
},{
  id: 'p4',
  title: '创建时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var makingOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目决策',
  datas: [{
    p1: '重庆广电vBRAS商务和技术双第一，已中标。 目前已开始部署，并计划割接现网用户上来。',
    p2: '没有结论',
    p3: '张三',
    p4: '	2018-10-12'
  }],
  columns: makingColumns,
  gridContainer: 'makingContainer',
  toolbarContainer: 'makingToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var makingGrid = $.fn.dlshouwen.grid.init(makingOption);
$(function () {
  makingGrid.load();
});

// 线索负责人或销售
var cluesColumns = [{
  id: 'p1',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '进展和困难',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p3',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p4',
  title: '负责人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
},{
  id: 'p5',
  title: '职位',
  type: 'string',
  // width: 75,
  columnClass: 'text-center',
},{
  id: 'p6',
  title: '更新时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var cluesOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '线索负责人或销售',
  datas: [{
    p1: '关键成果测试数据',
    p2: '进展和困难测试数据',
    p3: '下一步计划测试数据',
    p4: '张三',
    p5: '售前产品经理',
    p6: '2018-01-02',
  }],
  columns: cluesColumns,
  gridContainer: 'cluesContainer',
  toolbarContainer: 'cluesToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var cluesGrid = $.fn.dlshouwen.grid.init(cluesOption);
$(function () {
  cluesGrid.load();
});

// 售前产品经理
var psaleColumns = [{
  id: 'p1',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '进展和困难',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p3',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p4',
  title: '负责人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
},{
  id: 'p5',
  title: '职位',
  type: 'string',
  // width: 75,
  columnClass: 'text-center',
},{
  id: 'p6',
  title: '更新时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var psaleOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '售前产品经理',
  datas: [{
    p1: '关键成果测试数据',
    p2: '进展和困难测试数据',
    p3: '下一步计划测试数据',
    p4: '张三',
    p5: '售前产品经理',
    p6: '2018-01-02',
  }],
  columns: psaleColumns,
  gridContainer: 'psaleContainer',
  toolbarContainer: 'psaleToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var psaleGrid = $.fn.dlshouwen.grid.init(psaleOption);
$(function () {
  psaleGrid.load();
});

// 交付经理
var deliveryColumns = [{
  id: 'p1',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '进展和困难',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p3',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p4',
  title: '负责人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
},{
  id: 'p5',
  title: '职位',
  type: 'string',
  // width: 75,
  columnClass: 'text-center',
},{
  id: 'p6',
  title: '更新时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var deliveryOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '交付经理',
  datas: [{
    p1: '关键成果测试数据',
    p2: '进展和困难测试数据',
    p3: '下一步计划测试数据',
    p4: '张三',
    p5: '售前产品经理',
    p6: '2018-01-02',
  }],
  columns: deliveryColumns,
  gridContainer: 'deliveryContainer',
  toolbarContainer: 'deliveryToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var deliveryGrid = $.fn.dlshouwen.grid.init(deliveryOption);
$(function () {
  deliveryGrid.load();
});

// 现场工程师
var sceneColumns = [{
  id: 'p1',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '进展和困难',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p3',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p4',
  title: '负责人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
},{
  id: 'p5',
  title: '职位',
  type: 'string',
  // width: 75,
  columnClass: 'text-center',
},{
  id: 'p6',
  title: '更新时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var sceneOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '现场工程师',
  datas: [{
    p1: '关键成果测试数据',
    p2: '进展和困难测试数据',
    p3: '下一步计划测试数据',
    p4: '张三',
    p5: '售前产品经理',
    p6: '2018-01-02',
  }],
  columns: sceneColumns,
  gridContainer: 'sceneContainer',
  toolbarContainer: 'sceneToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var sceneGrid = $.fn.dlshouwen.grid.init(sceneOption);
$(function () {
  sceneGrid.load();
});

// 项目经理
var pmpColumns = [{
  id: 'p1',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '进展和困难',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p3',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p4',
  title: '负责人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
},{
  id: 'p5',
  title: '职位',
  type: 'string',
  // width: 75,
  columnClass: 'text-center',
},{
  id: 'p6',
  title: '更新时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var pmpOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目经理',
  datas: [{
    p1: '关键成果测试数据',
    p2: '进展和困难测试数据',
    p3: '下一步计划测试数据',
    p4: '张三',
    p5: '售前产品经理',
    p6: '2018-01-02',
  }],
  columns: pmpColumns,
  gridContainer: 'pmpContainer',
  toolbarContainer: 'pmpToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var pmpGrid = $.fn.dlshouwen.grid.init(pmpOption);
$(function () {
  pmpGrid.load();
});

// 需求管理专员
var demandColumns = [{
  id: 'p1',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '进展和困难',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p3',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p4',
  title: '负责人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
},{
  id: 'p5',
  title: '职位',
  type: 'string',
  // width: 75,
  columnClass: 'text-center',
},{
  id: 'p6',
  title: '更新时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var demandOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '需求管理专员',
  datas: [{
    p1: '关键成果测试数据',
    p2: '进展和困难测试数据',
    p3: '下一步计划测试数据',
    p4: '张三',
    p5: '售前产品经理',
    p6: '2018-01-02',
  }],
  columns: demandColumns,
  gridContainer: 'demandContainer',
  toolbarContainer: 'demandToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var demandGrid = $.fn.dlshouwen.grid.init(demandOption);
$(function () {
  demandGrid.load();
});

// 问题管理专员
var problemColumns = [{
  id: 'p1',
  title: '关键成果',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '进展和困难',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p3',
  title: '下一步计划',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p4',
  title: '负责人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
},{
  id: 'p5',
  title: '职位',
  type: 'string',
  // width: 75,
  columnClass: 'text-center',
},{
  id: 'p6',
  title: '更新时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var problemOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '问题管理专员',
  datas: [{
    p1: '关键成果测试数据',
    p2: '进展和困难测试数据',
    p3: '下一步计划测试数据',
    p4: '张三',
    p5: '售前产品经理',
    p6: '2018-01-02',
  }],
  columns: problemColumns,
  gridContainer: 'problemContainer',
  toolbarContainer: 'problemToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var problemGrid = $.fn.dlshouwen.grid.init(problemOption);
$(function () {
  problemGrid.load();
});

// 开票记录
var mklogColumns = [{
  id: 'p1',
  title: '开票金额',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '￥' + value + '元';
    return content;
  }
}, {
  id: 'p2',
  title: '开票人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '开票时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
},{
  id: 'p4',
  title: '开票内容',
  type: 'string',
  columnClass: 'text-left',
},{
  id: 'p5',
  title: '税率',
  type: 'string',
  width: 50,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = value + '%';
    return content;
}
}];
var mklogOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '开票记录',
  datas: [{
    p1: '￥999.00元',
    p2: '张三',
    p3: '2018-01-05',
    p4: '测试内容',
    p5: '17%'
  }],
  columns: mklogColumns,
  gridContainer: 'mklogContainer',
  toolbarContainer: 'mklogToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var mklogGrid = $.fn.dlshouwen.grid.init(mklogOption);
$(function () {
  mklogGrid.load();
});


// 回款记录
var reclogColumns = [{
  id: 'p1',
  title: '回款金额',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '￥' + value + '元';
    return content;
  }
}, {
  id: 'p2',
  title: '经办人',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
}, {
  id: 'p3',
  title: '回款日期',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
},{
  id: 'p4',
  title: '回款说明',
  type: 'string',
  // width: 75,
  columnClass: 'text-left',
}];
var reclogOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '回款记录',
  datas: [{
    p1: '￥999.00元',
    p2: '张三',
    p3: '2017-02-15',
    p4: '回款说明测试数据'
  }],
  columns: reclogColumns,
  gridContainer: 'reclogContainer',
  toolbarContainer: 'reclogToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var reclogGrid = $.fn.dlshouwen.grid.init(reclogOption);
$(function () {
  reclogGrid.load();
});

// 项目目标
var targetColumns = [{
  id: 'p1',
  title: '项目目标',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '完成时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var targetOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目目标',
  datas: [{
    p1: '项目目标测试数据',
    p2: '2017-01-05'
  }],
  columns: targetColumns,
  gridContainer: 'targetContainer',
  toolbarContainer: 'targetToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var targetGrid = $.fn.dlshouwen.grid.init(targetOption);
$(function () {
  targetGrid.load();
});

// 项目指标
var indicatorsColumns = [{
  id: 'p1',
  title: '指标名称',
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '指标描述',
  type: 'string',
  // width: 75,
  columnClass: 'text-left',
},{
  id: 'p3',
  title: '完成时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var indicatorsOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目指标',
  datas: [{
    p1: '指标名称测试数据',
    p2: '指标描述测试数据',
    p3: '2017-06-02'
  }],
  columns: indicatorsColumns,
  gridContainer: 'indicatorsContainer',
  toolbarContainer: 'indicatorsToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var indicatorsGrid = $.fn.dlshouwen.grid.init(indicatorsOption);
$(function () {
  indicatorsGrid.load();
});

// 会议纪要
var meetingColumns = [{
  id: 'p1',
  title: '会议时间',
  type: 'string',
  width: 110,
  columnClass: 'text-left',
}, {
  id: 'p2',
  title: '会议主题',
  type: 'string',
  // width: 75,
  columnClass: 'text-center',
},{
  id: 'p3',
  title: '会议内容',
  type: 'string',
  // width: 75,
  columnClass: 'text-left',
},{
  id: 'p4',
  title: '上传人员',
  type: 'string',
  width: 75,
  columnClass: 'text-center',
},{
  id: 'p5',
  title: '上传时间',
  type: 'string',
  width: 110,
  columnClass: 'text-center',
}];
var meetingOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '会议纪要',
  datas: [{
    p1: '2017-02-04',
    p2: '会议主题测试数据',
    p3: '会议内容测试数据',
    p4: '张三',
    p5: '2017-05-08'
  }],
  columns: meetingColumns,
  gridContainer: 'meetingContainer',
  toolbarContainer: 'meetingToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var meetingGrid = $.fn.dlshouwen.grid.init(meetingOption);
$(function () {
  meetingGrid.load();
});

// $("#beginTime").datepicker({
//   format: 'yyyy-mm-dd'
// });
// $("#endTime").datepicker({
//   format: 'yyyy-mm-dd'
// });